/-app
/-app/layout
Application.html
TestCase.html
TestPage.css
TestPage.html
/-app/tests
TestCase.ts
TestPage.ts
Application.ts
PageLayout.ts
functions.ts
/-boot
boot.css
boot.d.ts
early-0.js
early-1-with-knockout.js
/-docs
/-features
/-imports
/-imports/knockout
knockout-3.0.0.js
/-imports/shims
/-koBindings ...
scroll.ts
/-storage
/-tests
/-tests/storage
_sampleTests.ts
/-typings
knockout.d.ts
websql.d.ts
base.css
stringUtils.ts
teapo.html
1
module teapo.koBindings {
2
 
3
  export class Scroll implements KnockoutBindingHandler {
4
 
5
    options: any = {};
6
 
7
    private _log: string[] = [];
8
 
9
    constructor() {
10
      
11
    }
12
 
13
    init(
14
      element: any,
15
      valueAccessor: () => any,
16
      allBindingsAccessor: () => any,
17
      viewModel: any,
18
      bindingContext: KnockoutBindingContext): void { 
19
 
20
      var value = valueAccessor();
21
        
22
      var headTag = element.outerHTML.slice(0, element.outerHTML.indexOf('>')+1);
23
      this._log.push('init(' + headTag + ') ' + typeof value +' ' + JSON.stringify(value));
24
        console.log('init(' + headTag + ') ' + typeof value + ' ', value);
25
 
26
      element.textContent = this._log.join(' \n ');
27
    }
28
 
29
    update(
30
      element: any,
31
      valueAccessor: () => any,
32
      allBindingsAccessor: () => any,
33
      viewModel: any,
34
      bindingContext: KnockoutBindingContext): void {
35
 
36
 
37
      var value = valueAccessor();
38
 
39
      var headTag = element.outerHTML.slice(0, element.outerHTML.indexOf('>') + 1);
40
      this._log.push('update(' + headTag + ') ' + typeof value + ' ' + JSON.stringify(value));
41
      this._log.push('update(' + headTag + ') ' + typeof value + ' ', value);
42
 
43
      element.textContent = this._log.join(' \n ');
44
    }
45
 
46
    
47
  }
48
 
49
  var scroll = new Scroll();
50
  ko.bindingHandlers['scroll'] = { init: (el, val, vi, bi) => (<any>scroll).init(el, val, vi, bi), update: (el, val, al, vi, bi) => (<any>scroll).update(el, val, al, vi, bi) };
51
  
52
}